
//
//  UIBarButtonItem+Extention.swift
//  MicroBlog
//
//  Created by 002 on 15/10/26.
//  Copyright © 2015年 002. All rights reserved.
//

import UIKit

extension UIBarButtonItem {

    convenience init(imageName : String,target: AnyObject?,actionName : String?) {
        let button = UIButton.init(imageName: imageName, backImageName: nil)
        
        // 判断 是否有 actionName
        if let actionName = actionName {
            button.addTarget(target, action: Selector(actionName), forControlEvents: UIControlEvents.TouchUpInside)
        }
        self.init(customView: button)
    }
}
